var o = getApp();

Page({
    data: {
        homeUrl: ""
    },
    bindEdit: function(o) {
        var t = o.detail.value;
        console.log(t), this.setData({
            homeUrl: t
        });
    },
    clickSave: function(t) {
        var a = this, n = this.data.homeUrl;
        console.log("11" + n), o.network.post({
            url: o.url.updateHomeUrl,
            params: {
                homeUrl: n
            },
            before: function() {
                wx.showNavigationBarLoading();
            },
            success: function(t) {
                1 == t.data.result ? (a.getData(), setTimeout(function() {
                    o.util.showToast("修改成功");
                }, 1500)) : o.util.showToast(t.data.message);
            },
            fail: function() {
                o.util.showToast("修改失败");
            },
            complete: function() {
                wx.hideNavigationBarLoading();
            }
        });
    },
    getData: function() {
        o.network.post({
            url: o.url.userInfo,
            params: {},
            before: function() {},
            success: function(t) {
                if (1 == t.data.result) {
                    t.data.data;
                    o.globalData.userInfo = t.data.data.info, wx.navigateBack({});
                }
            },
            fail: function() {},
            complete: function() {
                wx.hideLoading();
            }
        });
    },
    onLoad: function(t) {
        var a = o.globalData.userInfo.homeUrl;
        this.setData({
            homeUrl: a
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {}
});